﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using DataAccess;
using TaskManagement.ModelLayer;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
            TaskContext context = new TaskContext();
            var query = from t in context.TaskEntitySet select t;
            ProjectEntity p = new ProjectEntity();
            p.Description = "A project";
            p.Name = "Das project";
            p.StartDate = DateTime.Now;
            WorkflowEntity w = new WorkflowEntity();
            w.Description = "A workflow";
            w.Name = "Das workflow";
            w.StartDate = DateTime.Now;
            p.WorkflowEntitys.Add(w);
       
            TaskEntity task = new TaskEntity();
            task.Account = "FIX";
            task.Date = DateTime.Now;
            task.Delivery = "DEL";
            task.Description = "Descfix";
            task.Estimate = 8;
            task.Status = "Active";
            task.Tag = "FIX DEL1";
            task.TimeSpent = 7;
            task.EmployeeEntity = new EmployeeEntity();
            task.EmployeeEntity.Email = "Kasper@hej.com";
            task.EmployeeEntity.EmployedAs = "Dev";
            task.EmployeeEntity.FirstName = "Kasper";
            task.EmployeeEntity.LastName = "Laurberg";
            task.EmployeeEntity.PhoneNumber = "09090909";
            w.TaskEntitys.Add(task);
            context.ProjectEntitySet.Add(p);
            context.SaveChanges();
            IDBTask dbTask = new DBTask();
            Task searchTask = new Task();
            searchTask.Description = "Descfix";
            searchTask.Delivery = "DEL";
            searchTask.Tag = "FIX DEL1";
            IList<Task> taskList = dbTask.SearchTask(searchTask);
            List<TaskEntity> list = query.ToList();
            */
            WebClient client = new WebClient();
            byte[] array= client.DownloadData(new Uri("http://localhost:8080/TaskService/rest/GetData?value=12"));

            WebRequest request = HttpWebRequest.Create("http://localhost:8080/TaskService/rest/GetData?value=12");
            request.Method = "POST";
            request.ContentLength = 0;

            WebResponse responce = request.GetResponse();
        }
    }
}
